#ifndef UART_H
#define UART_H 1

// #define UART_PL01X
// #define UART_TUBE

#ifdef UART_TUBE
#define UART_BASE_ADDR 0x13000000
#endif

#ifdef UART_PL01X
/* for foundation platform*/
#define UART_BASE_ADDR 0x1c090000
#endif

#ifndef UART_BASE_ADDR
#error "please set UARTTYPE: -DUART_PL01X or -DUART_TUBE"
#endif

#define UART_BAUD_RATE 512000

#ifdef UART_PL01X

#define uart_init _pl01x_init
#define uart_getc _pl01x_getc
#define uart_putc _pl01x_putc

#ifndef ASM_SOURCE
void _pl01x_init(void *uart_base_addr, int baud_divisor);
void _pl01x_putc(const char c);
char _pl01x_getc();
#endif

#endif /*end ifdef PL01X*/

#ifdef UART_TUBE
#define uart_init _gem5_init
#define uart_getc _gem5_getc
#define uart_putc _gem5_putc

#ifndef ASM_SOURCE
void _gem5_init(void *uart_base_addr, int baud_divisor);
void _gem5_putc(const char c);
char _gem5_getc();
#endif

#endif /* end ifdef UART_TUBE*/

#endif